Character is an immediate type. Characters are manipulated primarily by converting into an integer and accessing these fields:
not particularly useful.
Characters should be converted to and from integers by using the
char-int and int-char functions, which the compiler translates into
these VOPs:
In the common case where Char is known to be a string-char, these
operations are equivalent to char-code and code-char. In addition to
providing a portable interface to character conversion, the VOP representation
of this type conversion allows the compiler to avoid unnecessary boxing and
unboxing of character objects.
Existing code explicitly converts fixnums to characters by using the Make-Immediate-Type sub-primitive with of characters to fixnums is rather confused. Originally, characters were a subtype of the Misc type code, and the result of the Make-Fixnum sub-primitive had to be masked with other code may not.
Character comparisons could be implemented by doing numeric comparisons on the
result of char-int, or by using eq in the case of char=, but this
can result in unnecessary type conversions. Instead, the compiler uses these
conditional VOPs: